#include "team.hh"

Team::Team ()
{
}
Team::~Team ()
{
}

bool
Team::is_dead ()
{
  return ant_.empty ();
}

void
Team::move ()
{
  std::vector<Ants*>::iterator	it;

  for (it = ant_.begin (); it != ant_.end (); it++)
    (*it)->get_next_step ();
}

Ants*
Team::add_ant (std::string name, int posx, int posy)
{
  if (name == "queen")
    ant_.push_back (new Queen (posx, posy, this));
  else if (name == "food_worker")
    ant_.push_back (new Worker (posx, posy));
  else if (name == "water_worker")
    ant_.push_back (new Worker (posx, posy));
  else if (name == "fighter")
    ant_.push_back (new Fighter (posx, posy));

  ant_.back ()->set_team (id_);
  return ant_.back ();
}

void
Team::set_id (int n)
{
  id_ = n;
}

int
Team::get_id ()
{
  return id_;
}

std::vector<Ants*>
Team::get_ant ()
{
  return ant_;
}
